home *** CD-ROM | disk | FTP | other *** search
/ westlife Cardz: Kian / westlife: Kian.iso / pc / lyrics.dxr / 00006.ls < prev    next >
Encoding:
Text File  |  2000-10-23  |  2.9 KB  |  137 lines

  1. property mySprite, answered, attempts
  2.  
  3. on beginSprite me
  4.   global response, textresponse, prompts
  5.   mySprite = me.spriteNum
  6.   sprite(mySprite).locH = 320
  7.   sprite(mySprite).locV = 240
  8.   sprite(mySprite).cursor = 280
  9.   member("answer1").text = EMPTY
  10.   member("answer2").text = EMPTY
  11.   response = 0
  12.   textresponse = 0
  13.   prompts = 0
  14.   answered = 0
  15.   attempts = 0
  16. end
  17.  
  18. on mouseDown me
  19.   sprite(mySprite).member = 3
  20.   sprite(mySprite).locH = 320
  21.   sprite(mySprite).locV = 240
  22. end
  23.  
  24. on mouseEnter me
  25.   sprite(mySprite).member = 2
  26.   sprite(mySprite).locH = 320
  27.   sprite(mySprite).locV = 240
  28. end
  29.  
  30. on mouseUp me
  31.   global ganswered
  32.   sprite(mySprite).member = 4
  33.   sprite(mySprite).locH = 320
  34.   sprite(mySprite).locV = 240
  35.   if answered = 1 then
  36.     ganswered = ganswered + 1
  37.     submitanswer2()
  38.   else
  39.     if attempts = 2 then
  40.       ganswered = ganswered + 1
  41.       submitanswer2()
  42.     else
  43.       if attempts = 0 then
  44.         checkanswers()
  45.         submitanswer()
  46.       else
  47.         submitanswer()
  48.       end if
  49.     end if
  50.   end if
  51. end
  52.  
  53. on mouseLeave me
  54.   sprite(mySprite).member = 4
  55.   sprite(mySprite).locH = 320
  56.   sprite(mySprite).locV = 240
  57. end
  58.  
  59. on submitanswer
  60.   global scorez, response, textresponse
  61.   if (member("answer1").text = "picture") and (member("answer2").text = "secret") then
  62.     response = 1
  63.     textresponse = 1
  64.     answered = 1
  65.     attempts = 1
  66.     scorez = scorez + 1
  67.   else
  68.     response = 2
  69.     textresponse = 2
  70.     attempts = attempts + 1
  71.   end if
  72. end
  73.  
  74. on submitanswer2
  75.   global whichframenow
  76.   go(whichframenow)
  77. end
  78.  
  79. on checkanswers
  80.   if member("answer1").text = "picture" then
  81.     member("answer1").text = "picture"
  82.   else
  83.     member("answer1").text = EMPTY
  84.   end if
  85.   if member("answer2").text = "secret" then
  86.     member("answer2").text = "secret"
  87.   else
  88.     member("answer2").text = EMPTY
  89.   end if
  90. end
  91.  
  92. on exitFrame
  93.   global ganswered, response, textresponse, prompts
  94.   if answered = 1 then
  95.     if ganswered = 2 then
  96.       textresponse = 4
  97.       prompts = 3
  98.       member("answer1").editable = 0
  99.       member("answer2").editable = 0
  100.     else
  101.       prompts = 1
  102.       response = 1
  103.       member("answer1").editable = 0
  104.       member("answer2").editable = 0
  105.     end if
  106.   else
  107.     if attempts = 1 then
  108.       prompts = 2
  109.     else
  110.       if attempts = 2 then
  111.         if ganswered = 2 then
  112.           textresponse = 4
  113.           response = 3
  114.           prompts = 3
  115.           member("answer1").editable = 0
  116.           member("answer2").editable = 0
  117.           sprite(3).locH = -500
  118.           sprite(5).locH = -500
  119.           sprite(6).locH = -500
  120.           sprite(8).locH = -500
  121.           sprite(9).locH = -500
  122.         else
  123.           textresponse = 3
  124.           prompts = 1
  125.           sprite(3).locH = -500
  126.           sprite(5).locH = -500
  127.           sprite(6).locH = -500
  128.           sprite(8).locH = -500
  129.           sprite(9).locH = -500
  130.           member("answer1").editable = 0
  131.           member("answer2").editable = 0
  132.         end if
  133.       end if
  134.     end if
  135.   end if
  136. end
  137.